/*
 * @Author: wangtao
 * @Date: 2021-01-14 16:00:34
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-01-28 10:58:54
 * @Description: file content
 */
import React, { Component, Fragment } from 'react';
import { TouchableOpacity, StyleSheet, View, TextInput } from 'react-native';
import {
  px2dp,
  mainBgColorLightGray,
  mainBgColorWhite,
} from '../../../../../common/styles/index';
import { _, BackImage, msg } from '../../../../../common';

export default class SelectAddressHeader extends Component {
  componentDidMount() {}

  componentWillUnmount() {}

  render() {
    const { changeAddress } = this.props;
    return (
      <View style={styles.header}>
        <TouchableOpacity
          onPress={() => {
            msg.emit('router: back');
          }}
          activeOpacity={0.8}
          style={styles.backImg}
        >
          <BackImage />
        </TouchableOpacity>
        <View style={styles.addressInputWrap}>
          <TextInput
            onChangeText={(val) => {
              changeAddress(val);
            }}
            defaultValue=''
            placeholder='请输入详细地址'
            style={styles.addressInput}
          />
        </View>
      </View>
    );
  }
}
const styles = StyleSheet.create({
  header: {
    height: px2dp(104),
    flexDirection: 'row',
    alignItems: 'center',
    backgroundColor: mainBgColorWhite,
  },
  backImg: {
    width: px2dp(84),
    height: '100%',
    alignItems: 'center',
    justifyContent: 'center',
  },
  addressInputWrap: {
    width: px2dp(634),
    height: px2dp(82),
  },
  addressInput: {
    backgroundColor: mainBgColorLightGray,
    borderRadius: px2dp(8),
    fontSize: px2dp(32),
    height: px2dp(84),
  },
});
